/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.skuboard.entity;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author clockbuilder
 */
@Entity
@Table(name = "courses_has_students")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CoursesHasStudents.findAll", query = "SELECT c FROM CoursesHasStudents c"),
    @NamedQuery(name = "CoursesHasStudents.findByCoursesId", query = "SELECT c FROM CoursesHasStudents c WHERE c.coursesHasStudentsPK.coursesId = :coursesId"),
    @NamedQuery(name = "CoursesHasStudents.findByStudentsstudentId", query = "SELECT c FROM CoursesHasStudents c WHERE c.coursesHasStudentsPK.studentsstudentId = :studentsstudentId")})
public class CoursesHasStudents implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CoursesHasStudentsPK coursesHasStudentsPK;

    public CoursesHasStudents() {
    }

    public CoursesHasStudents(CoursesHasStudentsPK coursesHasStudentsPK) {
        this.coursesHasStudentsPK = coursesHasStudentsPK;
    }

    public CoursesHasStudents(String coursesId, String studentsstudentId) {
        this.coursesHasStudentsPK = new CoursesHasStudentsPK(coursesId, studentsstudentId);
    }

    public CoursesHasStudentsPK getCoursesHasStudentsPK() {
        return coursesHasStudentsPK;
    }

    public void setCoursesHasStudentsPK(CoursesHasStudentsPK coursesHasStudentsPK) {
        this.coursesHasStudentsPK = coursesHasStudentsPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (coursesHasStudentsPK != null ? coursesHasStudentsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CoursesHasStudents)) {
            return false;
        }
        CoursesHasStudents other = (CoursesHasStudents) object;
        if ((this.coursesHasStudentsPK == null && other.coursesHasStudentsPK != null) || (this.coursesHasStudentsPK != null && !this.coursesHasStudentsPK.equals(other.coursesHasStudentsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.skuboard.entity.CoursesHasStudents[ coursesHasStudentsPK=" + coursesHasStudentsPK + " ]";
    }
    
}
